import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import element from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/ICON/iconfont.css'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
router.beforeEach((to, from, next) => {
    const container = document.querySelector(".el-main");//回到顶部
    if (container) {
        container.scrollTo(0, 0);
    }
    next()
})
createApp(App).use(store).use(router).use(scroll).use(element).mount("#app");